package com.yuezhi.inv.service.impl;

import com.yuezhi.inv.entity.Stock;
import com.yuezhi.inv.mapper.StockMapper;
import com.yuezhi.inv.service.CommodityBillService;
import com.yuezhi.inv.service.StockService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author boys
 * @since 2020-12-21
 */
@Service
public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements StockService {

    @Autowired
    private CommodityBillService commodityBillService;
    @Override
    public List<Stock> queryStockByDepotAndCommon(String depotId, String commId) {
        List<String> list = commodityBillService.selectCommIdListByName(commId);
        List<Stock> stocks = baseMapper.selectStockVo(depotId, list);
        return stocks;
    }
}
